<?php

/**
 * @author luhua
 */
class EmailTaskModel extends Model {

    protected $_validate = array(
        array('title', 'require', '{%v_title_is_required}'),
        array('begin_time', 'require', '{%v_begin_time_is_required}'),
        array('begin_at', 'checkBeginAt', '{%v_begin_at_is_required} ', 0, 'callback'),
        array('template_id', 'number', '{%v_template_is_required}'),
        array('interval', 'number', '{%v_interval_is_required}'),
        array('email_limit', 'number', '{%v_email_limit_is_required}')
    );
    
    public function checkBeginAt($beginAt){
        if(date('Y-m-d',strtotime($beginAt)) != date('Y-m-d',time()) ) {
            return false;
        }
        return true;
    }


}

?>
